#ifndef CONTROLLERHEADER
#define CONTROLLERHEADER
#include "../Common/Common.h"

#define ROLE_PEOPLE 0
#define ROLE_BOSS_VICE 1
#define ROLE_BOSS 2

int role;

Task* headTask;
Task* tailTask;

Network_Node_Info me;
SOCKET PINodeSocket[MAXCONN];
int userNumber[MAXCONN];
int PINodeNumber;
SOCKET taskSockServer;
SOCKET testerConn;
SOCKET viceListenSock;
HANDLE ImBossEvent;
int wasVice;

//sys control node
void addTask(TOperationInfo op, int isTodoTask);

//backup process
void initBackupModule(void *args);
void sendBackupData(Task *task, char op);

int findBoss(void);
HANDLE getMutex(void);

#endif
